package com.cro.prison.controller;

import com.cro.prison.entity.vo.TrackNameVo;
import com.cro.prison.entity.vo.TrackVo;
import com.cro.prison.service.TrackService;
import com.cro.prison.utils.Code;
import com.cro.prison.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/track")
public class TrackController {


    @Autowired
    TrackService trackService;
    @GetMapping("/getTrackListById")
    public Result getTrackListById(Long id){
        List<TrackVo> trackVos = trackService.getTrackListById(id);
        return new Result(Code.GET_OK,trackVos);
    }

    @GetMapping("/getTrackNames")
    public Result getTrackNames(){
        List<TrackNameVo> trackNames = trackService.getTrackNames();
        return new Result(Code.GET_OK,trackNames);
    }


}
